package com.yckj.day07;

public class Father2 {
    public int age = getAge();

    static{
        System.out.println("父类静态代码块1");
    }
    // 父类静态属性
    static int num = getNum();

    {
        System.out.println("父类构造代码块2");
    }

    {
        System.out.println("父类构造块1");
    }
    public static int getNum(){
        System.out.println("getNum()....执行了，父类静态属性赋值了");
        return 22;
    }

    public int getAge(){
        System.out.println("父类的非静态方法执行了，给非静态属性赋值了");
        return 30;
    }

    public Father2() {
        System.out.println("父类无参构造方法。。");
    }

    public Father2(int age) {
        System.out.println("父类有参构造方法。。。");
        this.age = age;
    }
}
